package com.csis.framework.util.jqgrid;


/**
 * response for client jqGrid data
 * 
 * @author dailey_dai
 * 
 */
public class JqGridResponse {

	public static enum ResponseType {
		XML, JSON
	}

	public static JqGridResponse build(String responseContent) {
		JqGridResponse response = new JqGridResponse();
		response.setContent(responseContent);
		return response;
	}

	public static JqGridResponse build(String responseContent, ResponseType responseType) {
		JqGridResponse response = new JqGridResponse();
		response.setContent(responseContent);
		response.setType(responseType);
		return response;
	}

	private ResponseType type = ResponseType.XML;

	private String content;

	public ResponseType getType() {
		return type;
	}

	void setType(ResponseType responseType) {
		this.type = responseType;
	}

	/**
	 * @return String response for JqGrid
	 */
	public String getContent() {
		return content;
	}

	void setContent(String responseContent) {
		this.content = responseContent;
	}

	@Override
	public String toString() {
		return "JqGridResponse [type=" + type + ", content=" + content + "]";
	}

}
